package com.wangnan.currentactivity.Dao;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

/*
 * Package    :com.wangnan.currentactivity.Dao
 * ClassName  :BillListDatabase
 * Description:
 * Data       :2021/1/27/027 14:34
 */
@Database(entities = {BillList.class}, version = 2, exportSchema = false)
public abstract class BillListDatabase extends RoomDatabase {

	private static BillListDatabase INSTANCE;

	static synchronized BillListDatabase getDatabase(Context context) {
		if (INSTANCE == null) {
			INSTANCE = Room.databaseBuilder(context.getApplicationContext(), BillListDatabase.class, "bill_database")
					//					.allowMainThreadQueries() //为了不再主线程我们用AsyncTask
					.build();
		}
		return INSTANCE;
	}

	public abstract BillListDao getBillListDao();
}